package org.example.designPattern.structural.decorator;

import java.math.BigDecimal;

public class Egg extends Food{
    private Food food;

    public Egg(Food food) {
        this.food = food;
        addPrice();
    }

    @Override
    protected void addPrice() {
        price = food.price.add(new BigDecimal(1));
        System.out.println("当前总金额：" + price);
    }
}
